1. Field of the Invention
The present invention relates to a multi-tasking system, and a medium and a processing device in which a program thereof is recorded, and more particularly, relates to a multi-tasking system having a safety function, and a medium and a processing device in which a program thereof is recorded.
2. Description of the Prior Art
Previously, when controlling a system having a plurality of devices such as a robot or a peripheral device, a multi-tasking system has widely been utilized, which has a multi-tasking function of simultaneously executing a plurality of programs (tasks). Japanese Patent Laid-Open No. 7-129418 discloses a program control system in a multi-tasking environment, in which parental relation is set between programs corresponding to respective devices and a subtask is automatically executed when a main task is started, so as to make it easy to start a plurality of programs. Furthermore, Japanese Patent Laid-Open No. 8-263127 discloses a numerical controller, in which tasks are constituted separately by a task including a command to an external device with the communication function and a task including a command relating to the robot control, so as to make a program easily by the separate constitution of the task relating to the communication and the task relating to the control. Furthermore, Japanese Patent Laid-Open No. 8-339211 discloses a control device in an automatic machine, in which a monitoring task for monitoring the error state of the total system is provided besides a task for controlling each device such as a robot, and the above described monitoring task is processed in parallel with a task allocated to each device, so that even when any device causes an error, a suitable processing can immediately be ordered to each task according to contents thereof.
By the way, an emergency stop switch, a temporary stop switch, a safety guard, or the like for insuring safety is generally connected to a controller for controlling a device such as a machine tool or an industrial robot by a multi-tasking, and it has a safety function such as emergency stop means which stops a robot by cutting off the electric power supplied to a driving motor of the movable portion and simultaneously stops a task in the case where the emergency stop switch is pressed down or the door of the safety guard is opened, or temporary stop means which temporarily stops the robot and task.
In the case where such a safety function is used in a controller to which for example, a control system disclosed in Japanese Patent Laid-Open No. 7-129418 is applied, a main task is stopped first, and a subtask is consequently stopped. Thus, in the prior art, it is configured that all tasks are stopped when the safety function is actuated, and there is no consideration of continuing the execution of part of tasks such as the communication processing with a host computer, whose execution is wanted even when the safety function is actuated. Accordingly, there has been such a problem that the state of a machine cannot be transmitted to the operator or the host computer at the time of an emergency stop or a temporary stop and that a sufficient monitoring cannot be performed.
The device disclosed in Japanese Patent Laid-Open No. 8-263127 is a device in which a task relating to the communication with an external device is configured apart from a task for controlling a machine, but the tasks are merely configured separately. Therefore, it does not perform such different controls for respective tasks that the execution is continued as for a task of a necessary part like a task relating to the communication even when the safety function is actuated as mentioned above, and other tasks relating to the machine control are stopped as usual.
Herein, in order to avoid the above described stop of all tasks, there is an effective method of programming the safety function by the user without using the safety function on the controller side as disclosed in Japanese Patent Laid-Open No. 8-339211, or of constructing a system by using a controller for each device such as a robot. However, in case of the former method, the danger because of program errors cannot be avoided, and further, if the monitoring task is stopped there is a possibility of occurrence of such a very dangerous state that the task for operating the robot cannot be stopped, and the robot is not stopped even when the emergency stop switch is pressed. Furthermore, in case of the latter method, the cost is raised since a plurality of controller are necessary, and in addition to that, there is such a problem that the synchronous processing is required between controllers and the program becomes complicated.
The present invention is made in consideration of such a viewpoint, and it is an object to provide a multi-tasking system in which the control of devices is safely and easily performed with one controller by making the action of the safety function different for each group to which each task belongs and in which each device can be monitored at all times, and a medium and a processing device in which a program for the system is recorded.
A multi-tasking system according to the present invention is a multi-tasking system for controlling a plurality of tasks, and it has program executing means which processes a plurality of tasks by the multi-tasking processing and a task table which keeps grouping information set for each of the plurality of tasks. The program executing means has stop means as a safety function, and the stop means obtains the grouping information from the task table in accordance with a stop instruction, identifies each group of the tasks, and performs a different control for each group.
Furthermore, the stop means of the multi-tasking system according to the present invention terminates or temporarily stops the execution of the tasks belonging to a first group identified on the basis of the grouping information of the task table, and continues the execution of the tasks belonging to a second group.
Moreover, the first group of the multi-tasking system according to the present invention is a machine controlling group including tasks for controlling devices, and the second group is a machine monitoring group including tasks for performing the monitoring processing or communication processing.
Herein, device means, for example, a machine with a movable portion.
The multi-tasking system according to the present invention is a multi-tasking system for controlling a plurality of tasks, and it has program executing means which processes a plurality of tasks by the multi-tasking processing and a task table which keeps the group information as for which of the machine monitoring group including tasks for monitoring processing of devices or communication processing with an external device and the machine controlling group including tasks for controlling operation of devices, each of the plurality of tasks belongs to, and the state information as for which of various states including the executing state and the temporary stop state, each of the plurality of tasks exists in. The program executing means has emergency stop means and temporary stop means as the safety function. The emergency stop means accesses the above described task table in accordance with an emergency stop instruction to identify a group to which each task belongs, terminates tasks belonging to the machine controlling group and renews contents of the above described task table. The temporary stop means accesses the task table in accordance with a temporary stop instruction to identify a group to which each task belongs, temporarily stops tasks belonging to the machine controlling group and renews contents of the task table. The emergency stop means and temporary stop means have a function to continue the executing state of the tasks belonging to the machine monitoring group.
Furthermore, the multi-tasking system according to the present invention is a multi-tasking system provided with display means for displaying contents of the task table.
A recording medium according to the present invention is a recording medium, wherein a program for functioning as any one of the above described respective multi-tasking systems is recorded.
A processing device according to the present invention has at least any one of the above described respective multi-tasking systems, a first device controlled by the machine controlling group, and a second device controlled by the machine monitoring group, and controls stop or continuation for each group to which respective devices belong by the stop means in the multi-tasking system.
According to the present invention, different controls are performed for each group to which respective tasks belong by the stop means as a safety function, so that it is possible to perform a control complying with the level of safety required in each group.
Furthermore, the stop means does not terminate or temporarily stop tasks of all groups, but it terminates or temporarily stops only the tasks of a certain group in accordance with a stop instruction. Therefore, for example, if a task for controlling a machine with a movable portion is classified into the above described group, it is possible to continue a desired monitoring while keeping safety. Furthermore, since such controls of termination and temporary stop of tasks are performed by the stop means of the program executing means, the danger because of a program error can be avoided, and a safer system can be configured, in comparison with a conventional method in which the user programs the safety function.
Furthermore, by the safety function of the program executing means, tasks belonging to the machine controlling group to control devices are terminated, and tasks belonging to the machine monitoring group to perform monitoring processing and communication processing are continued. Therefore, the controls of devices can safely and easily be performed by one program executing means, and it is also possible to monitor each device at all times.